﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace Group3Game
{
    public partial class GameForm : Form
    {
        //Tråden som Xna kommer köras i.
        static ThreadStart t = new ThreadStart(Run);
        static Thread thread = new Thread(t);

        public static Thread XnaThread
        {
            get { return thread; }
        }

        public GameForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            thread.Start();
            this.Close();
        }

        static void Run()
        {
            using (Game1 game = new Game1()) {
                    game.Run();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
    }
}
